import request from '@/utils/request'
//获取平台总问题数
export const getTotalProblemAPI = () => {
  return request.post('/TotalProblem')
}
//获取平台总用户数
export const getTotalUserAPI = () => {
  return request.post('/TotalUser')
}
//获取平台总用户数
export const getTotalMoneyAPI = () => {
  return request.post('/NewLogin')
}
//获取平台总回答数
export const getTotalAnswerAPI = () => {
  return request.post('/TotalAnswer')
}
//获取今日新发布问题数
export const getNewProblemAPI = () => {
  return request.post('/NewProblem')
}
//获取今日新发布回答数
export const getNewAnswerAPI = () => {
  return request.post('/NewAnswer')
}
//获取今日平台登录人数
export const getTodayInfoAPI = () => {
  return request.post('/TodayLogin')
}
//登录接口
export const userLoginService = ({ AdminPassword, AdminAccount }) => {
  return request.post('/adminLogin', { AdminPassword, AdminAccount })
}
//获取用户交易明细
export const getUserTransactionAPI = (UserNamet) => {
  return request.post(`/Last/${UserNamet}`)
}
//通过用户名获取用户信息
export const getUserInfoAPI = (name) => {
  return request.post(`/SelectUserByName/${name}`)
}

//获取所有用户信息
export const getAllUserInfoAPI = () => {
  return request.post('/user')
}

//封禁账号
export const disableUserAPI = (UserName) => {
  return request.post(`/DisableUser/${UserName}`)
}
//解封账号
export const enableUserAPI = (UserName) => {
  return request.post(`/AbleUser/${UserName}`)
}

//获取所有tag信息
export const getAllTagInfoAPI = () => {
  return request.post('/tag')
}

//编辑tag
export const editTagAPI = (tag) => {
  return request.post('/EditTag', tag)
}
//添加tag
export const addTagAPI = (tag) => {
  return request.post('/AddTag', tag)
}
//删除tag
export const deleteTagAPI = (tag) => {
  return request.post('/DeleteTag', tag)
}

//获取所有问题信息
export const getAllQuestionInfoAPI = () => {
  return request.post('/problem')
}
//禁用问题
export const disableQuestionAPI = (problem) => {
  return request.post('/DisableProblem', problem)
}
//解禁问题
export const enableQuestionAPI = (problem) => {
  return request.post('/AbleProblem', problem)
}
//获取所有被举报问题
export const getAllReportQuestionAPI = () => {
  return request.post('/JuBaoWenTi')
}
//举报被举报的问题
export const dishableReportQuestionAPI = (ProblemId) => {
  return request.post(`/DisAbleJuBaoProblem/${ProblemId}`)
}
//解封被举报的问题
export const enableReportQuestionAPI = (problemId) => {
  return request.post(`/AbleJuBaoProblem/${problemId}`)
}

//获取所有被举报的回答
export const getAllReportAnswerAPI = () => {
  return request.post('/JuBaoHuiDa')
}
//举报被举报的回答
export const dishableReportAnswerAPI = (AnswerId) => {
  return request.post(`/DisAbleJuBaoAnswer/${AnswerId}`)
}
//解封被举报的回答
export const enableReportAnswerAPI = (AnswerId) => {
  return request.post(`/AbleJuBaoAnswer/${AnswerId}`)
}
